home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Applications / MilkShape 3D / L3D_Overview.txt < prev    next >
Text File  |  2001-11-20  |  13KB  |  228 lines

  1. Creating your own Black & White models with MilkShape
  2. (c) 2001 DragonZap, dragonzap1@aol.com
  3.  
  4. Creating your own meshes for use with Black & White is a fairly simple matter.
  5. In the case of the MilkShape plug-ins that I've written, you simply import
  6. the skeleton and maybe the mesh, make the changes you want, and export the new
  7. L3D file using the skeleton from the original L3D file. Then you replace the
  8. model or models in your "Data\CreatureMesh" directory in your Black & White
  9. installation folder and you're done.
  10.  
  11. While that outlines the basic idea of how to create new models, there are
  12. some things you will have to be careful about as you go around making new
  13. models. Thus, I will go into further detail on the B&W model replacement
  14. process.
  15.  
  16. Step 1: Import the skeleton and maybe the mesh, and generate a .BWC script
  17. --------------------------------------------------------------------------
  18. The first step in creating a new model for Black & White using the MilkShape
  19. plug-ins is to import the skeleton. As of this writing, you cannot create your
  20. own skeletons or animations, so you must use an existing one.
  21.  
  22. To do this from MilkShape, open the "File" menu, go down to "Import", and
  23. select "Black & White L3D". (This assumes you have already installed the
  24. files necessary for the L3D plug-ins. If you don't see "Black & White L3D",
  25. refer back to msL3DTools.txt, included with the plug-ins. If you followed
  26. the installation instructions there and still don't see it, send me an
  27. e-mail at dragonzap1@aol.com)
  28.  
  29. Depending on which model you wish to replace, you may select any of the L3D
  30. files associated with it to retrieve a skeleton from, such as the
  31. good/neutral/evil models for creatures, or any of the three hand models if you
  32. wish to replace those, but MAKE SURE YOU REMEMBER WHICH FILE YOU GOT IT FROM.
  33. This will be necessary later on.
  34.  
  35. Once you select a file to import, an options dialog will appear with a list
  36. of possible settings to use when importing the L3D file. For our purposes,
  37. we will want to leave the skeleton selection on its default setting
  38. ("Import skeleton without rotation information...") and leave the
  39. "Clear all before import" option checked.
  40.  
  41. At this point, you will need to decide whether you want to create a completely
  42. new model, or make some changes to the one you're importing. If you want to
  43. create a new model, then you will want to uncheck "Import Mesh", and probably
  44. also want to uncheck "Extract textures to external files" if you intend to
  45. make your own skin to accompany the model you're creating. On the other hand,
  46. if you wish to make a modification to an existing model so that your new
  47. model's morph targets will work with the originals, you will want to make sure
  48. both "Import Mesh" and "Insert extra triangles to preserve morph targets" are
  49. checked off. Currently you MUST do this if you wish to replace any of the
  50. hand models, as the game tends to freeze if you try to make your own hand
  51. model from scratch (I'm assuming there's some hand models somewhere that I did
  52. not replace when I tried it).
  53.  
  54. The import plug-in, by default, chooses some texture filenames automatically
  55. when it goes to extract the textures from the L3D file, but if you want to,
  56. you can choose alternate filenames by selecting the appropriate texture ID
  57. in the listbox and clicking the "Select Texture File" or
  58. "Select Alpha Texture File" buttons. Textures are currently exported in
  59. .BMP format.
  60.  
  61. You will also want to generate a .BWC script. BWC files are a custom format
  62. that go along with the MilkShape plug-ins, and are used for putting some of
  63. the information in the .CBN files into human-readable form. They are text
  64. files, and as such can be edited with your favorite text editor. To make
  65. a .BWC script, check off the "Extract CBN info from..." box, and select
  66. a .CBN file in the first edit field. If you have not already chosen a .BWC
  67. filename, one will be chosen for you. Otherwise, you can select one
  68. yourself.
  69.  
  70. Once you select all your options, click "Ok" and if all goes well, the
  71. skeleton (and mesh, if you imported it) should appear in MilkShape's view
  72. windows.
  73.  
  74.  
  75. Step 2: Making the new mesh
  76. ---------------------------
  77. The details of actually making a model with MilkShape are beyond the scope of
  78. this tutorial, but there are plenty of MilkShape tutorials out there on the
  79. Internet that can cover this topic. However, when making a model for
  80. Black & White, there are a few things you need to be aware of:
  81.  
  82. First, do not move the bones around in any way. If you do, the changes will
  83. not be reflected when you go to export your model, and it will animate
  84. strangely in game. Secondly, do not do anything that changes the order of the
  85. bones. You should be able to rename them with no problem, but if you add or
  86. delete bones, you may screw up the algorithm that decides how to properly
  87. match them up with the skeletons from existing files.
  88.  
  89. Secondly, if you chose to import the mesh and preserve the morph targets,
  90. do not do ANYTHING that modifies the number of triangles or vertices. Do not
  91. weld them together, do not subdivide them, do not reassign their bones, do not
  92. do anything except move them around and change their textures and texture
  93. coordinates. If you don't follow this advice and you save your changes, you
  94. will have to either start over, or settle for replacing all models of a given
  95. type (seven for creature models, or three for the hand model). Also, if you
  96. already made a model based off an original with an older version of the
  97. plug-ins, I'm sorry, but it won't work with the originals unless you re-make
  98. it.
  99.  
  100. On the other hand, if you chose to make a completely new mesh, you will need to
  101. assign each vertex to one of the many bones in the imported skeletons. Which
  102. bones they are assigned to is an artistic matter and entirely up to you.
  103. If you're not sure how to assign bones, look for a MilkShape tutorial.
  104.  
  105. If you decide to replace textures, (also known as skins) make sure the images
  106. are 256x256 pixels; no more, no less. The exporter will accept abnormally-sized
  107. textures, but they will be resized as needed, and tend to not look as good
  108. in-game. Also, textures will be quantized to 16 shades of red/green/blue and
  109. 16 alpha values if you choose to use an alpha channel. 4096 colors
  110. (16 * 16 * 16 = 4096) is generally enough for most everyone's purposes.
  111. Texture files can be in any format supported by the FreeImage library,
  112. (generally, if you can see it properly in MilkShape, it should work with the
  113. exporter) but for compatibility purposes it's probably best to stick to .BMP or
  114. .TGA files.
  115.  
  116. From what I've read, Black & White's engine will determine bruise positions
  117. automatically, but for it to do this properly, you will need to make sure that
  118. no polygons on your UV texture map overlap. This means you cannot re-use any
  119. part of your texture on more than one part of your model.
  120.  
  121. Step 3: Exporting your new model
  122. --------------------------------
  123. Once you've made the changes and such that you desire, it's time to export
  124. your L3D file. Go to the "File" menu in MilkShape, open the "Export" submenu,
  125. and select "Black & White L3D". (Again, this assumes you've properly installed
  126. the plug-in files.) Select a file name to export to (do NOT overwrite the
  127. model you got the skeleton from, as you will need it) and you will be presented
  128. with an options dialog. The options for exporting are fewer than those for
  129. importing, but still just as important.
  130.  
  131. If you are replacing a fat/thin/strong/weak model for a creature, you will
  132. want to make sure "Export textures" is NOT checked off. For all other purposes,
  133. it's probably best to leave it enabled.
  134.  
  135. If you previously chose to modify an existing mesh instead of creating a
  136. completely new one, you will want to make sure
  137. "Preserve morph targets from imported model" is checked off. If you don't,
  138. your model will not work properly with the others in-game, and you will have to
  139. replace all the models from the set. Otherwise, leave that option unchecked.
  140.  
  141. Lastly, you will want to check off "Use existing skeleton from:" and click on
  142. the "..." button to select the original L3D file from which you got your
  143. skeleton from. This is very important -- you will ALWAYS need to do this to
  144. create a model that will work in-game. Also, due to some problems with texture
  145. filenames in MilkShape, this model should be in the same directory as your
  146. texture files, or the textures may not be exported properly.
  147.  
  148. If you only want to change the skins of a model, and not the model itself,
  149. you can check off "Only replace textures" to tell the plug-in not to replace
  150. any other information.
  151.  
  152. Once everything is set, click "OK" to export your model.
  153.  
  154. At this point, you may create other morph target versions of your model by
  155. moving vertices around and altering the textures, and exporting them exactly
  156. as you did with the first one. Morph targets are how Black & White blends
  157. models together to give each one a unique shape, such as a spiky, menacing
  158. sort of look for evil models, or a soft, cuddly look for good models.
  159. Also, remember that you don't need to export textures for fat/thin/strong/weak
  160. models. If you have to replace all the models of a specific type (either a
  161. creature or the hand) but you're feeling lazy, you can just copy your first
  162. model several times over rather than making new morph target versions.
  163.  
  164. Step 4: Modifying the .BWC script
  165. ---------------------------------
  166. Chances are you will want to make a new CBN file to go along with your custom
  167. mesh. Using a .CBN file properly means that end users will only have to replace
  168. the .CBN files in their directories, and do not have to overwrite existing
  169. .L3D files. See the included BWC_Commands.txt for more information on the
  170. available .BWC script commands. When you're ready, load your base model into
  171. MilkShape, and then under the "Tools" menu, select
  172. "Compile Black & White BWC Script". From there, you will be prompted to select
  173. the .BWC file which will be used to create your .CBN file, and also the
  174. base .L3D file that goes along with the model you currently have loaded.
  175. You will also need to select a base .CBN file to use as a template similar
  176. to what was necessary when exporting the .L3D files, as I don't yet understand
  177. all of the fields in .CBN files. Lastly, you will need to select the filename
  178. of your new .CBN file. (Do NOT make it the same as your base .CBN file or
  179. bad things will happen.)
  180.  
  181. If the .BWC script has any errors, the plug-in will let you know what line
  182. and what went wrong.
  183.  
  184. Step 5: Getting the model in the game
  185. -------------------------------------
  186. To get your model or models into the game, you will have to copy them to the
  187. "Data\CreatureMesh" directory, or wherever it was you found the original
  188. model that you got the skeleton from. It used to be that you had to overwrite
  189. the originals. This is NO LONGER TRUE for .L3D files, assuming that you changed
  190. the filenames in your .BWC script. However, it's probably a good idea to back
  191. up your original .CBN and model files first anyway so that you don't have to
  192. re-install the game if you mess up.
  193.  
  194. If you chose to create a new .CBN file, you will have to copy that to the
  195. "Data\CTR" directory, and in that case you WILL need to overwrite the .CBN
  196. file of whatever creature you used as a base. (It should also be possible to
  197. replace the .CBN file of any creature.)
  198.  
  199. When you export a new model, you will need to create a total of 7 model files.
  200. Let's take the cow model as an example. If I made a completely new cow model,
  201. I would have to make new versions of the following files:
  202.     C_Cow_Boned.l3d
  203.     C_Cow_Evil.l3d
  204.     C_Cow_Good.l3d
  205.     C_Cow_Fat.l3d
  206.     C_Cow_Thin.l3d
  207.     C_Cow_Strong.l3d
  208.     C_Cow_Weak.l3d
  209.  
  210. The first three would need textures, while the last four would not. On the
  211. other hand, if I only tweaked the cow mesh and made sure to preserve the
  212. morph targets correctly, I would only need to make new versions of the model
  213. or models that I changed.
  214.  
  215. If you did everything correctly, then once you start the game, you should
  216. have your new model, which uses all the animations of the old one. You may
  217. notice that the eyes and/or hair or tail are not in the correct positions.
  218. Right now there's not much I can do about this, as I'm still not sure how
  219. Black & White determines eyeball positions or hair positions. You just have
  220. to sort of live with it for now. Remember that it's all still beta.
  221.  
  222. Additionally, if you chose to modify an existing mesh rather than create
  223. your own, there may be some shading problems on texture boundaries, even
  224. if the normals are properly set up on the model.
  225. This should not occur with meshes made from scratch.
  226.  
  227. Send questions/comments/bug reports to dragonzap1@aol.com. English only,
  228. please, as that's the only language I know.